package za.co.smartmi.model;

import java.io.Serializable;

public class SystemUserRole implements Serializable
{
	/** 
	 * This attribute maps to the column username in the system_user_role table.
	 */
	protected String username;

	/** 
	 * This attribute maps to the column role in the system_user_role table.
	 */
	protected String role;

	/**
	 * Method 'SystemUserRole'
	 * 
	 */
	public SystemUserRole()
	{
	}

	/**
	 * Method 'getUsername'
	 * 
	 * @return String
	 */
	public String getUsername()
	{
		return username;
	}

	/**
	 * Method 'setUsername'
	 * 
	 * @param username
	 */
	public void setUsername(String username)
	{
		this.username = username;
	}

	/**
	 * Method 'getRole'
	 * 
	 * @return String
	 */
	public String getRole()
	{
		return role;
	}

	/**
	 * Method 'setRole'
	 * 
	 * @param role
	 */
	public void setRole(String role)
	{
		this.role = role;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof SystemUserRole)) {
			return false;
		}
		
		final SystemUserRole _cast = (SystemUserRole) _other;
		if (username == null ? _cast.username != username : !username.equals( _cast.username )) {
			return false;
		}
		
		if (role == null ? _cast.role != role : !role.equals( _cast.role )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		if (username != null) {
			_hashCode = 29 * _hashCode + username.hashCode();
		}
		
		if (role != null) {
			_hashCode = 29 * _hashCode + role.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return SystemUserRolePk
	 */
	public SystemUserRolePk createPk()
	{
		return new SystemUserRolePk(username, role);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "za.co.smartmi.dto.SystemUserRole: " );
		ret.append( "username=" + username );
		ret.append( ", role=" + role );
		return ret.toString();
	}

}
